app.directive("banner",function(){

	return {
		templateUrl:"component/banner.html",
		replace:true,
		restrict:"E",
		controller:function($scope,$http){
		$scope.swiper =	function(){
        	var mySwiper = new Swiper('.swiper-container',{
            loop: true,
            autoplay: 3000,
            observer:true,//修改swiper自己或子元素时，自动初始化swiper
            observeParents:true,//修改swiper的父元素时，自动初始化swiper
            autoplayDisableOnInteraction:true,//用户操作swiper之后是否禁止autoplay
            });
        }
              $scope.slider=[];
              $http({
              	method:"GET",
              	url:"http://h5.yztctech.net/api/axf/apihome.php"

              }).success(function(res){
              	console.log(res);
              	$scope.slider=res.data.slide;
              	 // $timeout(function(){
              	 // 	swiper();
              	 // },300)
              })

		}
       
	}

})